var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
    })(e, t);
}, function(e, t) {
    function r() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, 
    new r());
}), a = this && this.__decorate || function(e, t, r, o) {
    var i, n = arguments.length, c = n < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, r) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(e, t, r, o); else for (var p = e.length - 1; 0 <= p; p--) (i = e[p]) && (c = (n < 3 ? i(c) : 3 < n ? i(t, r, c) : i(t, r)) || c);
    return 3 < n && c && Object.defineProperty(t, r, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("LoadManager"), s = e("HeadView"), c = cc._decorator, l = c.ccclass, d = c.property, u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.headView = null, e.sprite = null, e.rankLabel = null, e.player = null, 
        e;
    }
    return i(e, t), e.prototype.start = function() {}, e.prototype.init = function(e) {
        this.player = e, this.refresh();
    }, e.prototype.refresh = function() {
        this.headView.init(this.player.model.icon, this.player.model.nickname, this.player.model.personIdx).catch(function(e) {
            return cc.log(e);
        });
    }, e.prototype.showSprite = function(e, t) {
        var o = this;
        this.sprite && r.default.getInstance().loadSpriteFrame({
            url: e,
            sprite: this.sprite,
            success: function() {
                o.sprite.node.active = !0;
            }
        }), t && this.scheduleOnce(this.hideSprite, t);
    }, e.prototype.hideSprite = function() {
        this.unschedule(this.hideSprite), this.sprite && (this.sprite.node.active = !1);
    }, a([ d(s.default) ], e.prototype, "headView", void 0), a([ d(cc.Sprite) ], e.prototype, "sprite", void 0), 
    a([ d(cc.Label) ], e.prototype, "rankLabel", void 0), a([ l ], e);
}(cc.Component);

n.default = u;